package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张杰
 * Date: 2022-08-13
 * Time: 9:55
 */
@Mapper //mybatis interface
public interface UserMapper {

    // 根据用户 id 查询用户
    public UserInfo getUserById(@Param("id") Integer id);

    //修改方法[根据id修改名称]
    public int update(@Param("id") Integer id,
                      @Param("username") String username);

    //删除方法
    public int del(@Param("id")Integer id);

    //添加用户，返回受影响的行数
    public int add(UserInfo userInfo);
}
